﻿using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Drawing;
using System.Data;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using System.Windows.Forms;

using Urgencias.Controlador;

namespace Urgencias.Vista
{
    public partial class LoginUserControl : UserControl
    {
        public LoginUserControl()
        {
            InitializeComponent();
        }

        public void loginButton_Click(object sender, EventArgs e)
        {
            //Conexion.Instance
            string myuser=usernameTB.Text;
            string mypass = passwordTB.Text;

            if (Conexion.Instance.conectar(myuser,mypass))
            {
                //return true;
                Principal.Instance.refrescarBarra();
                Principal.Instance.limpiar();                
            }
            else
            {
                MessageBox.Show(Properties.Resources.LogInInvalido);
                //return false;
            }
        }
    }
}
